﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{
    KH_Admin kh = new KH_Admin();
    DangKy dk = new DangKy();
    DataConnection dt = new DataConnection();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        bool gt = true;
        if (RadioButtonList1.Items[0].Selected == true)
            
            gt = true;
        else
            gt = false;

       dk.ThemKH(TextBox1.Text,TextBox2.Text, TextBox3.Text, gt, TextBox10.Text, TextBox11.Text,TextBox5.Text,TextBox7.Text);
        Label1.Text = "Đăng ký thành công.";
    }
    protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
    {
        //SqlParameter p1 = new SqlParameter("@ten", args.Value);
        //string sql = "select TenDN from KhachHang where TenDN=@ten";
        //DataTable tbl = dt.GetData(sql, p1);
        //if (tbl.Rows.Count > 0)
        //    args.IsValid = false;
        //else
        //    args.IsValid = true;
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        TextBox1.Text = "";
        TextBox2.Text = "";
        TextBox3.Text = "";
        TextBox10.Text = "";
        TextBox11.Text = "";
        TextBox5.Text = "";
        TextBox7.Text = "";
    }
}
